
//就诊人---->入院就诊人查询
function loadDetail4_in(param) {
    showDetail();
    if (param.MictypeId == 1) {
        param.ybType = "省医保"
    } else if (param.MictypeId == 2) {
        param.ybType = "市医保"
    } else {
        param.ybType = param.MictypeId
    }
    $(".detailWindow .title").html(param.title);
    $(".detailWindow .subTitle").html(param.cPatientName + "<span>门诊号：" +  param.cCaseCode+ "</span>");
    $(".detailWindow .ruleInfo").html("");
    $(".detailWindow .ruleInfo").append('<div class="ruleTitle">性别：' + param.iSex + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;年龄：'+param.iYearsOld+  '&nbsp;岁&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;主诊断：'+ param.cDiagResult +'</div>');
    $(".detailWindow .detailFoot .info").html("<h3>启用日期：" + param.dstartdate + "</h3>");
    $(".detailWindow .tableGroups").remove("");

    var tableGroup1 = $("<div class='tableGroups'></div>");
    $(".detailWindow .detailBody").append(tableGroup1);
    var url ="/quality/poor/queryMoneyDetailList/" + param.inpcode;
    var groupDrg = getGroupObj("费用明细");
    tableGroup1.append(groupDrg);
    loadServerData(url, null, function (data) {
        var tr = $("<tr style='font-weight:bolder'></tr>");
        groupDrg.find("table").append(tr);
        tr.append($("<td>治疗项目</td>"));
        tr.append($("<td>主治医生</td>"));
        tr.append($("<td>总费用</td>"));
        tr.append($("<td>丙类费用</td>"));
        tr.append($("<td>时间</td>"));
        for (var i = 0; i < data.datas.length;) {
            var tr = $("<tr></tr>");
            groupDrg.find("table").append(tr);
            for (var j = 0; j < 1; j++) {
                if (i < data.datas.length) {
                    tr.append($("<td>" + (data.datas[i].Icd10Name.substr(0,15)) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].Doctorname) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].InMoney) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].blmoney) + "</td>"));
                    tr.append($("<td>" + (data.datas[i].dinhos) + "</td>"));
                    i++;
                } else {
                    break;
                }
            }
        }
        resizeDetail();
    })
}


//就诊人---->出院就诊人查询
    function loadDetail4_out(param, disTab) {
        if (param.MedId == 1) {
            param.ybType = "省医保"
        } else if (param.MedId == 2) {
            param.ybType = "市医保"
        }
        showDetail();
        $(".detailWindow .title").html(param.title);
        $(".detailWindow .subTitle").html(param.cPatientName + "<span>门诊号：" +  param.cCaseCode+ "</span>");
        $(".detailWindow .ruleInfo").html("");
        $(".detailWindow .ruleInfo").append('<div class="ruleTitle">性别：' + param.iSex + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;年龄：'+param.iYearsOld+  '&nbsp;岁&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;主诊断：'+ param.cDiagResult +'</div>');
        $(".detailWindow .detailFoot .info").html("<h3>启用日期：" + param.dstartdate + "</h3>");
        $(".detailWindow .tableGroups").remove("");
        var tableGroup1 = $("<div class='tableGroups'></div>");
        $(".detailWindow .detailBody").append(tableGroup1);
        var url ="/quality/poor/queryMoneyDetailList/" + param.inpcode;
        var groupDrg = getGroupObj("费用明细");
        tableGroup1.append(groupDrg);
        loadServerData(url, null, function (data) {
            var tr = $("<tr style='font-weight:bolder'></tr>");
            groupDrg.find("table").append(tr);
            tr.append($("<td>治疗项目</td>"));
            tr.append($("<td>主治医生</td>"));
            tr.append($("<td>总费用</td>"));
            tr.append($("<td>丙类费用</td>"));
            tr.append($("<td>时间</td>"));
            for (var i = 0; i < data.datas.length;) {
                var tr = $("<tr></tr>");
                groupDrg.find("table").append(tr);
                for (var j = 0; j < 1; j++) {
                    if (i < data.datas.length) {
                        tr.append($("<td>" + (data.datas[i].Icd10Name.substr(0,15)) + "</td>"));
                        tr.append($("<td>" + (data.datas[i].Doctorname) + "</td>"));
                        tr.append($("<td>" + (data.datas[i].InMoney) + "</td>"));
                        tr.append($("<td>" + (data.datas[i].blmoney) + "</td>"));
                        tr.append($("<td>" + (data.datas[i].dinhos) + "</td>"));
                        i++;
                    } else {
                        break;
                    }
                }
            }
            resizeDetail();
        })
    };